class SaleOrderoutstock {
  String? id;
  String? customername; //客户名称
  String? orderDate; //下单时间
  String? contractid; //销售订单号
  String? rowid; //销售订单行号
  String? escortcode; //押运单号
  String? productid; //产品编码
  String? productname; //产品名称
  String? productspec; //规格型号
  String? quantity; //发货数量
  String? outstocktime; //发货时间
  String? username; //负责人
  String? dayCount; //发货周期
  String? startDate;
  String? endDate;
  String? accountingName;
  String? cate;

  SaleOrderoutstock({
    this.id,
    this.customername,
    this.orderDate,
    this.contractid,
    this.rowid,
    this.escortcode,
    this.productid,
    this.productname,
    this.productspec,
    this.quantity,
    this.outstocktime,
    this.username,
    this.dayCount,
    this.startDate,
    this.endDate,
    this.accountingName,
    this.cate,
  });

  SaleOrderoutstock copyWith({
    String? id,
  }) {
    return new SaleOrderoutstock(
      id: id ?? this.id,
    );
  }

  @override
  String toString() {
    return '''SaleOrderoutstock{
      id: $id,
      customername: $customername,
      orderDate: $orderDate,
      contractid: $contractid,
      rowid: $rowid,
      escortcode: $escortcode,
      productid: $productid,
      productname: $productname,
      productspec: $productspec,
      quantity: $quantity,
      outstocktime: $outstocktime,
      username: $username,
      dayCount: $dayCount,
    }''';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is SaleOrderoutstock &&
          runtimeType == other.runtimeType &&
          id == other.id &&
          customername == other.customername &&
          orderDate == other.orderDate &&
          contractid == other.contractid &&
          rowid == other.rowid &&
          escortcode == other.escortcode &&
          productid == other.productid &&
          productname == other.productname &&
          productspec == other.productspec &&
          quantity == other.quantity &&
          outstocktime == other.outstocktime);

  factory SaleOrderoutstock.fromMap(Map<String, dynamic> map) {
    return new SaleOrderoutstock(
      id: map['id'] != false ? map['id'].toString() as String? : "",
      customername:
          (map['customername'] != false && map['customername'] != null)
              ? map['customername'].toString() as String?
              : "",
      orderDate: (map['order_date'] != false && map['order_date'] != null)
          ? map['order_date'].toString() as String?
          : "",
      contractid: (map['contractid'] != false && map['contractid'] != null)
          ? map['contractid'].toString()
          : "",
      rowid: (map['rowid'] != false && map['rowid'] != null)
          ? map['rowid'].toString() as String?
          : "",
      escortcode: (map['escortcode'] != false && map['escortcode'] != null)
          ? map['escortcode'].toString() as String?
          : "",
      productid: (map['productid'] != false && map['productid'] != null)
          ? map['productid'].toString() as String?
          : "",
      productname: (map['productname'] != false && map['productname'] != null)
          ? map['productname'].toString() as String?
          : "",
      productspec: (map['productspec'] != false && map['productspec'] != null)
          ? map['productspec'].toString() as String?
          : "",
      quantity: (map['quantity'] != false && map['quantity'] != null)
          ? map['quantity'].toString() as String?
          : "",
      outstocktime:
          (map['outstocktime'] != false && map['outstocktime'] != null)
              ? map['outstocktime'].toString() as String?
              : "",
      username: (map['username'] != false && map['username'] != null)
          ? map['username'].toString() as String?
          : "",
      dayCount: (map['day_count'] != false && map['day_count'] != null)
          ? map['day_count'].toString() as String?
          : "",
      accountingName: (map['accounting_name'] != false && map['accounting_name'] != null)
          ? map['accounting_name'].toString() as String?
          : "",
      cate: (map['cate'] != false && map['cate'] != null)
          ? map['cate'].toString() as String?
          : "",
    );
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'customername': this.customername,
      'orderDate': this.orderDate,
      'contractid': this.contractid,
      'rowid': this.rowid,
      'escortcode': this.escortcode,
      'productid': this.productid,
      'productname': this.productname,
      'productspec': this.productspec,
      'quantity': this.quantity,
      'outstocktime': this.outstocktime,
      'username': this.username,
      'dayCount': this.dayCount,
      'accountingName': this.accountingName,
      'cate': this.cate,
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    List list = [
      if (this.startDate != null && this.startDate != '')
        ['start_date', '=', this.startDate],
      if (this.endDate != null && this.endDate != '')
        ['end_date', '=', this.endDate],
    ] as List;
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'order_date': this.orderDate,
      'customername': this.customername,
      'contractid': this.contractid,
      'rowid': this.rowid,
      'escortcode': this.escortcode,
      'productid': this.productid,
      'productname': this.productname,
      'productspec': this.productspec,
      'quantity': this.quantity,
      'outstocktime': this.outstocktime,
      'username': this.username,
      'day_count': this.dayCount,
      'accounting_name': this.accountingName,
      'cate': this.cate,
    } as Map<String, dynamic>;
  }

//</editor-fold>

}
